﻿<!DOCTYPE html>
<html lang="zh"  xmlns:th="http://www.thymeleaf.org">
<head>
    <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.3.3/css/bootstrap.min.css" rel="stylesheet">
    <title>管理界面</title>
</head>
<body>
<div id="main">
    <div id="table_main">
        <div id="network_info">
            <h1>网络服务</h1>
            <table class="table table-primary">
                <tr>
                    <td>name</td>
                    <td>host</td>
                    <td>port</td>
                    <td colspan="2">actions</td>
                </tr>
                <tr th:each="service : ${networkServices}">
                    <td th:text="${service.name}"></td>
                    <td th:text="${service.domain}"></td>
                    <td th:text="${service.port}"></td>
                    <td>
                        <a th:href="@{'/info/update?service_name='+${service.name}}" th:text="@{'update '+${service.name}}"/>
                    </td>
                    <td>
                        <a th:href="@{'/info/delete?service_name='+${service.name}}" th:text="@{'delete '+${service.name}}"/>
                    </td>
                </tr>
            </table>
        </div>
        <div id="message_details">
            <h1>消息</h1>
            <table class="table table-light">
                <tr>
                    <td>sender location</td>
                    <td>time sent</td>
                    <td>message</td>
                </tr>
                <tr th:each="message : ${message_details}">
                    <td th:text="${message.sender}"></td>
                    <td th:text="${message.time}"></td>
                    <td th:text="${message.content}"></td>

                </tr>
            </table>
        </div>

        <a href="/info/update">add new service</a>
        <a href="/">back to chatroom</a>
    </div>
</div>
</body>
</html>